import type { Reciprocation } from '@/interface';
import { request } from '../request';

/**
 * 新建
 * @param data
 */
export function createReciprocation(data: Reciprocation) {
  return request.post<void>('/admin/reciprocation/create', data, {
    useErrMsg: true
  });
}

/**
 * 更新
 * @param data
 */
export function updateReciprocation(data: Reciprocation) {
  return request.post<void>('/admin/reciprocation/update', data, {
    useErrMsg: true
  });
}

/**
 * 列表
 * @param receivingId
 */
export function listReciprocation(receivingId: string) {
  return request.get<Common.Page<Reciprocation>>(`/admin/reciprocation/list?receivingId=${receivingId}`, null, {
    useErrMsg: true
  });
}

/**
 * 删除
 * @param id
 */
export function delReciprocation(id: string) {
  return request.delete<void>(`/admin/reciprocation/delete?id=${id}`, null, {
    useErrMsg: true
  });
}
